//
// Created by ole on 24-8-17.
//

#ifndef INTENT_H
#define INTENT_H
#include <map>
#include <string>

class Message final {
public:
    enum Priority {
        P_HIGHEST,
        P1,
        P_DEFAULT = P1,
        P3,
        P_LOWEST = 100
    };

    explicit Message(std::string action, std::string category = "", Priority priority = P_DEFAULT)
        : action(std::move(action)),
          category(std::move(category)),
          priority(priority) {
    }

    std::string getAction() const;

    void setAction(const std::string &action);

    std::string getCategory() const;

    void setCategory(const std::string &category);

    std::string getData() const;

    void setData(const std::string &data);

    int getFlag() const;

    void setFlag(const int &flag);

    void putString(const std::string &key, const std::string &value);

    void removeString(const std::string &key);

    void putInt(const std::string &key, const int &value);

    void removeInt(const std::string &key);

    std::string toString() const;

private:
    std::string action;
    std::string category;
    std::string data;
    Priority priority;
    int flag = 0;
    std::map<std::string, std::string> mapString;
    std::map<std::string, int> mapInt;
};

#endif //INTENT_H
